home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 15119 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  2.0 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 6e 65 | 77 73 2e 6d 61 75 69 2e |Path: ne|ws.maui.|
|00000010| 63 6f 6d 21 6e 65 77 73 | 0a 46 72 6f 6d 3a 20 22 |com!news|.From: "|
|00000020| 50 61 75 6c 20 41 2e 20 | 42 69 6c 6c 69 6e 67 73 |Paul A. |Billings|
|00000030| 22 20 3c 70 61 62 40 6d | 61 75 69 2e 63 6f 6d 3e |" <pab@m|aui.com>|
|00000040| 0a 4e 65 77 73 67 72 6f | 75 70 73 3a 20 63 6f 6d |.Newsgro|ups: com|
|00000050| 70 2e 6c 61 6e 67 2e 63 | 2b 2b 2c 63 6f 6d 70 2e |p.lang.c|++,comp.|
|00000060| 6f 73 2e 6d 73 2d 77 69 | 6e 64 6f 77 73 2e 70 72 |os.ms-wi|ndows.pr|
|00000070| 6f 67 72 61 6d 6d 65 72 | 2e 6d 69 73 63 0a 53 75 |ogrammer|.misc.Su|
|00000080| 62 6a 65 63 74 3a 20 52 | 65 3a 20 56 69 72 74 75 |bject: R|e: Virtu|
|00000090| 61 6c 20 66 75 6e 63 74 | 69 6f 6e 20 71 75 65 73 |al funct|ion ques|
|000000a0| 74 69 6f 6e 0a 44 61 74 | 65 3a 20 33 20 41 70 72 |tion.Dat|e: 3 Apr|
|000000b0| 20 31 39 39 36 20 31 39 | 3a 35 39 3a 31 38 20 47 | 1996 19|:59:18 G|
|000000c0| 4d 54 0a 4f 72 67 61 6e | 69 7a 61 74 69 6f 6e 3a |MT.Organ|ization:|
|000000d0| 20 4d 61 75 69 20 41 6e | 61 6c 79 73 69 73 20 61 | Maui An|alysis a|
|000000e0| 6e 64 20 53 79 6e 74 68 | 65 73 69 73 20 54 65 63 |nd Synth|esis Tec|
|000000f0| 68 6e 6f 6c 6f 67 69 65 | 73 0a 4d 65 73 73 61 67 |hnologie|s.Messag|
|00000100| 65 2d 49 44 3a 20 3c 34 | 6a 75 6c 61 6d 24 6f 37 |e-ID: <4|julam$o7|
|00000110| 66 40 77 61 65 6e 61 2e | 6d 61 75 69 2e 63 6f 6d |f@waena.|maui.com|
|00000120| 3e 0a 52 65 66 65 72 65 | 6e 63 65 73 3a 20 3c 34 |>.Refere|nces: <4|
|00000130| 6a 70 36 65 39 24 6f 75 | 35 40 64 75 62 2d 6e 65 |jp6e9$ou|5@dub-ne|
|00000140| 77 73 2d 73 76 63 2d 31 | 2e 63 6f 6d 70 75 73 65 |ws-svc-1|.compuse|
|00000150| 72 76 65 2e 63 6f 6d 3e | 0a 4e 4e 54 50 2d 50 6f |rve.com>|.NNTP-Po|
|00000160| 73 74 69 6e 67 2d 48 6f | 73 74 3a 20 6d 72 39 2d |sting-Ho|st: mr9-|
|00000170| 30 34 30 2e 64 69 61 67 | 73 6f 66 74 2e 6d 61 75 |040.diag|soft.mau|
|00000180| 69 2e 63 6f 6d 0a 4d 69 | 6d 65 2d 56 65 72 73 69 |i.com.Mi|me-Versi|
|00000190| 6f 6e 3a 20 31 2e 30 0a | 43 6f 6e 74 65 6e 74 2d |on: 1.0.|Content-|
|000001a0| 54 79 70 65 3a 20 74 65 | 78 74 2f 70 6c 61 69 6e |Type: te|xt/plain|
|000001b0| 3b 20 63 68 61 72 73 65 | 74 3d 75 73 2d 61 73 63 |; charse|t=us-asc|
|000001c0| 69 69 0a 43 6f 6e 74 65 | 6e 74 2d 54 72 61 6e 73 |ii.Conte|nt-Trans|
|000001d0| 66 65 72 2d 45 6e 63 6f | 64 69 6e 67 3a 20 37 62 |fer-Enco|ding: 7b|
|000001e0| 69 74 0a 58 2d 4d 61 69 | 6c 65 72 3a 20 4d 6f 7a |it.X-Mai|ler: Moz|
|000001f0| 69 6c 6c 61 20 31 2e 32 | 4e 20 28 57 69 6e 64 6f |illa 1.2|N (Windo|
|00000200| 77 73 3b 20 49 3b 20 33 | 32 62 69 74 29 0a 54 6f |ws; I; 3|2bit).To|
|00000210| 3a 20 52 6f 73 73 42 6f | 79 6c 61 6e 40 61 6f 6c |: RossBo|ylan@aol|
|00000220| 2e 63 6f 6d 0a 0a 52 6f | 73 73 42 6f 79 6c 61 6e |.com..Ro|ssBoylan|
|00000230| 40 61 6f 6c 2e 63 6f 6d | 20 28 52 6f 73 73 20 42 |@aol.com| (Ross B|
|00000240| 6f 79 6c 61 6e 29 20 77 | 72 6f 74 65 3a 0a 3e 49 |oylan) w|rote:.>I|
|00000250| 20 61 6d 20 74 72 79 69 | 6e 67 20 74 6f 20 64 65 | am tryi|ng to de|
|00000260| 66 69 6e 65 2c 20 61 20 | 6c 61 20 53 6d 61 6c 6c |fine, a |la Small|
|00000270| 74 61 6c 6b 2c 20 61 20 | 6d 69 78 2d 69 6e 20 77 |talk, a |mix-in w|
|00000280| 68 69 63 68 20 64 65 66 | 69 6e 65 73 20 74 68 65 |hich def|ines the|
|00000290| 0a 3e 76 61 72 69 6f 75 | 73 20 63 6f 6d 70 61 72 |.>variou|s compar|
|000002a0| 69 73 6f 6e 20 6f 70 65 | 72 61 74 6f 72 73 20 69 |ison ope|rators i|
|000002b0| 6e 20 74 65 72 6d 73 20 | 6f 66 20 6f 6e 65 20 66 |n terms |of one f|
|000002c0| 75 6e 64 61 6d 65 6e 74 | 61 6c 20 6f 70 65 72 61 |undament|al opera|
|000002d0| 74 6f 72 2c 20 3c 2e 0a | 3e 0a 3e 0a 3e 74 79 70 |tor, <..|>.>.>typ|
|000002e0| 65 64 65 66 20 69 6e 74 | 20 62 6f 6f 6c 3b 0a 3e |edef int| bool;.>|
|000002f0| 63 6c 61 73 73 20 52 42 | 4d 61 67 6e 69 74 75 64 |class RB|Magnitud|
|00000300| 65 20 7b 0a 3e 70 75 62 | 6c 69 63 3a 0a 3e 2f 2f |e {.>pub|lic:.>//|
|00000310| 73 75 62 63 6c 61 73 73 | 20 73 68 6f 75 6c 64 20 |subclass| should |
|00000320| 72 65 64 65 66 69 6e 65 | 20 3c 20 77 69 74 68 20 |redefine| < with |
|00000330| 61 70 70 72 6f 70 72 69 | 61 74 65 20 74 79 70 65 |appropri|ate type|
|00000340| 73 0a 3e 09 76 69 72 74 | 75 61 6c 20 62 6f 6f 6c |s.>.virt|ual bool|
|00000350| 20 6f 70 65 72 61 74 6f | 72 3c 28 63 6f 6e 73 74 | operato|r<(const|
|00000360| 20 52 42 4d 61 67 6e 69 | 74 75 64 65 26 29 20 63 | RBMagni|tude&) c|
|00000370| 6f 6e 73 74 3d 20 30 3b | 0a 3e 09 76 69 72 74 75 |onst= 0;|.>.virtu|
|00000380| 61 6c 20 62 6f 6f 6c 20 | 6f 70 65 72 61 74 6f 72 |al bool |operator|
|00000390| 3e 28 63 6f 6e 73 74 20 | 52 42 4d 61 67 6e 69 74 |>(const |RBMagnit|
|000003a0| 75 64 65 26 20 78 29 20 | 63 6f 6e 73 74 20 7b 72 |ude& x) |const {r|
|000003b0| 65 74 75 72 6e 20 20 2a | 74 68 69 73 20 3c 0a 3e |eturn *|this <.>|
|000003c0| 78 3b 7d 3b 0a 3e 2f 2f | 20 61 6e 64 20 6d 61 6e |x;};.>//| and man|
|000003d0| 79 20 6d 6f 72 65 0a 3e | 7d 3b 0a 3e 0a 3e 63 6c |y more.>|};.>.>cl|
|000003e0| 61 73 73 20 41 20 3a 20 | 70 75 62 6c 69 63 20 52 |ass A : |public R|
|000003f0| 42 4d 61 67 6e 69 74 75 | 64 65 20 7b 0a 3e 70 75 |BMagnitu|de {.>pu|
|00000400| 62 6c 69 63 3a 0a 3e 09 | 76 69 72 74 75 61 6c 20 |blic:.>.|virtual |
|00000410| 62 6f 6f 6c 20 6f 70 65 | 72 61 74 6f 72 3c 28 63 |bool ope|rator<(c|
|00000420| 6f 6e 73 74 20 41 26 20 | 61 29 20 63 6f 6e 73 74 |onst A& |a) const|
|00000430| 20 7b 72 65 74 75 72 6e | 20 28 74 68 69 73 2d 3e | {return| (this->|
|00000440| 6e 20 3c 20 61 2e 6e 29 | 3b 7d 3b 0a 3e 70 72 69 |n < a.n)|;};.>pri|
|00000450| 76 61 74 65 3a 0a 3e 09 | 69 6e 74 20 6e 3b 0a 3e |vate:.>.|int n;.>|
|00000460| 7d 3b 0a 3e 0a 3e 0a 3e | 63 6c 61 73 73 20 41 20 |};.>.>.>|class A |
|00000470| 74 65 73 74 3b 0a 3e 0a | 3e 54 68 69 73 20 66 61 |test;.>.|>This fa|
|00000480| 69 6c 73 20 69 6e 20 4d | 53 56 43 2b 2b 20 34 2e |ils in M|SVC++ 4.|
|00000490| 30 20 77 69 74 68 20 74 | 68 65 20 65 72 72 6f 72 |0 with t|he error|
|000004a0| 20 74 68 61 74 20 41 20 | 69 73 20 76 69 72 74 75 | that A |is virtu|
|000004b0| 61 6c 20 62 65 63 61 75 | 73 65 20 74 68 65 0a 3e |al becau|se the.>|
|000004c0| 6f 70 65 72 61 74 6f 72 | 3c 28 63 6f 6e 73 74 20 |operator|<(const |
|000004d0| 52 42 4d 61 67 6e 69 74 | 75 64 65 26 29 20 69 73 |RBMagnit|ude&) is|
|000004e0| 20 6e 6f 74 20 64 65 66 | 69 6e 65 64 2e 0a 0a 4d | not def|ined...M|
|000004f0| 53 56 43 27 73 20 69 6d | 70 6c 65 6d 65 6e 74 61 |SVC's im|plementa|
|00000500| 74 69 6f 6e 20 69 73 20 | 63 6f 72 72 65 63 74 2e |tion is |correct.|
|00000510| 20 20 59 6f 75 20 68 61 | 76 65 20 64 65 63 6c 61 | You ha|ve decla|
|00000520| 72 65 64 20 61 20 70 75 | 72 65 20 0a 76 69 72 74 |red a pu|re .virt|
|00000530| 75 61 6c 20 66 75 6e 63 | 74 69 6f 6e 20 6f 70 65 |ual func|tion ope|
|00000540| 72 61 74 6f 72 3c 28 52 | 42 4d 61 67 2e 2e 2e 29 |rator<(R|BMag...)|
|00000550| 2c 20 62 75 74 20 68 61 | 76 65 6e 27 74 20 64 65 |, but ha|ven't de|
|00000560| 66 69 6e 65 64 20 69 74 | 2e 20 20 0a 54 68 65 20 |fined it|. .The |
|00000570| 6f 6e 65 20 69 6e 20 41 | 20 69 73 20 64 69 66 66 |one in A| is diff|
|00000580| 65 72 65 6e 74 2e 20 20 | 49 66 20 79 6f 75 20 64 |erent. |If you d|
|00000590| 6f 6e 27 74 20 77 61 6e | 74 20 74 6f 20 64 65 66 |on't wan|t to def|
|000005a0| 69 6e 65 20 0a 41 3a 3a | 6f 70 65 72 61 74 6f 72 |ine .A::|operator|
|000005b0| 28 52 42 4d 61 67 29 20 | 74 6f 20 74 68 72 6f 77 |(RBMag) |to throw|
|000005c0| 20 61 6e 20 65 78 63 65 | 70 74 69 6f 6e 2c 20 64 | an exce|ption, d|
|000005d0| 65 66 69 6e 65 20 0a 52 | 42 4d 61 67 3a 3a 6f 70 |efine .R|BMag::op|
|000005e0| 65 72 61 74 6f 72 20 69 | 6e 73 74 65 61 64 20 6f |erator i|nstead o|
|000005f0| 66 20 6d 61 6b 69 6e 67 | 20 69 74 20 70 75 72 65 |f making| it pure|
|00000600| 2e 20 20 28 49 74 20 63 | 61 6e 20 62 65 20 61 6e |. (It c|an be an|
|00000610| 20 65 6d 70 74 79 20 0a | 66 75 6e 63 74 69 6f 6e | empty .|function|
|00000620| 20 7b 7d 2e 29 0a 0a 41 | 20 64 69 66 66 65 72 65 | {}.)..A| differe|
|00000630| 6e 74 20 61 70 70 72 6f | 61 63 68 20 77 6f 75 6c |nt appro|ach woul|
|00000640| 64 20 62 65 20 74 6f 20 | 68 61 76 65 20 6e 6f 6e |d be to |have non|
|00000650| 2d 76 69 72 74 75 61 6c | 20 6f 70 65 72 61 74 6f |-virtual| operato|
|00000660| 72 73 2e 20 20 0a 45 6e | 64 20 6f 66 20 70 72 6f |rs. .En|d of pro|
|00000670| 62 6c 65 6d 2e 20 20 54 | 68 69 73 20 69 73 20 74 |blem. T|his is t|
|00000680| 68 65 20 74 72 61 64 69 | 74 69 6f 6e 61 6c 20 6d |he tradi|tional m|
|00000690| 65 74 68 6f 64 2e 20 20 | 48 6f 77 65 76 65 72 2c |ethod. |However,|
|000006a0| 20 69 66 20 0a 79 6f 75 | 27 72 65 20 74 72 79 69 | if .you|'re tryi|
|000006b0| 6e 67 20 74 6f 20 62 65 | 20 61 62 6c 65 20 74 6f |ng to be| able to|
|000006c0| 20 63 6f 6d 70 61 72 65 | 20 64 65 72 69 76 65 64 | compare| derived|
|000006d0| 20 69 6e 73 74 61 6e 63 | 65 73 20 76 69 61 20 61 | instanc|es via a|
|000006e0| 20 0a 62 61 73 65 20 63 | 6c 61 73 73 20 70 6f 69 | .base c|lass poi|
|000006f0| 6e 74 65 72 2c 20 49 20 | 74 68 69 6e 6b 20 79 6f |nter, I |think yo|
|00000700| 75 27 64 20 68 61 76 65 | 20 74 6f 20 72 65 73 6f |u'd have| to reso|
|00000710| 72 74 20 74 6f 20 52 54 | 54 49 2e 20 20 0a 0a 54 |rt to RT|TI. ..T|
|00000720| 68 69 73 2c 20 6f 66 20 | 63 6f 75 72 73 65 2c 20 |his, of |course, |
|00000730| 61 73 73 75 6d 65 73 20 | 79 6f 75 20 77 61 6e 74 |assumes |you want|
|00000740| 20 74 6f 20 61 63 63 65 | 73 73 20 64 65 72 69 76 | to acce|ss deriv|
|00000750| 65 64 2d 63 6c 61 73 73 | 20 0a 69 6e 66 6f 72 6d |ed-class| .inform|
|00000760| 61 74 69 6f 6e 20 69 6e | 20 74 68 65 20 63 6f 6d |ation in| the com|
|00000770| 70 61 72 61 73 69 6f 6e | 2e 20 20 49 66 20 79 6f |parasion|. If yo|
|00000780| 75 20 63 61 6e 20 63 6f | 6d 70 61 72 65 20 62 61 |u can co|mpare ba|
|00000790| 73 65 64 20 6f 6e 20 0a | 62 61 73 65 2d 63 6c 61 |sed on .|base-cla|
|000007a0| 73 73 20 69 6e 66 6f 2c | 20 79 6f 75 20 64 6f 6e |ss info,| you don|
|000007b0| 27 74 20 68 61 76 65 20 | 61 20 70 72 6f 62 6c 65 |'t have |a proble|
|000007c0| 6d 3b 20 64 65 66 69 6e | 65 20 69 74 20 69 6e 20 |m; defin|e it in |
|000007d0| 74 68 65 20 0a 62 61 73 | 65 20 61 6e 64 20 64 65 |the .bas|e and de|
|000007e0| 72 69 76 65 64 20 63 6c | 61 73 73 65 73 20 69 6e |rived cl|asses in|
|000007f0| 68 65 72 69 74 20 69 74 | 2e 0a 0a 50 61 75 6c 0a |herit it|...Paul.|
|00000800| 0a | |. | |
+--------+-------------------------+-------------------------+--------+--------+